package com.zjweu.hkg.POJO;

import com.zjweu.hkg.utils.ConstUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Article {
    private int articleId;
    private String articleTitle;
    private String articleContent;
    private int authorUID;
    private Date createDate;
    private Date updateDate;
    private int readTime;
    private String articleUUID;
    private int permission;
    private int status;

    public static Article setArticleDelete(Article article){
        if(article==null){
            article=new Article();
        }
        article.setArticleId(-1);
        article.setArticleTitle("【已删除的文章】");
        article.setArticleContent(null);
        article.setAuthorUID(-1);
        article.setPermission(ConstUtil.ARTICLE_PERMISSION_PUBLIC);
        article.setStatus(ConstUtil.ARTICLE_STATUS_DELETED);
        return article;
    }
}
